<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <title>TCSM - FILS</title>
    </h:head>
    <h:body style="padding-top: 30px; background-color: gainsboro" >
        <p:clock/>
        <div align="center">
            <h1> Topic Classification in Social Media </h1>
            <h2> A study on the Romanian Blogosphere</h2>
        </div>

        <br/>
        <div align="center">
            <h:graphicImage value="images/#{classifierBean.drawChart()}"
                            style="height: 400px; width:550px;"
                            title="Scoring results"/> 
        </div>

        <p:spacer height="50"/>
        <div id="left" >
            <h:form>
                <table align="center">
                    <tr align="center">
                        <td>URL:</td>
                        <td>
                            <p:inputText value="#{classifierBean.URL}" id="url" label="url"
                                         required="true"
                                         requiredMessage="An URL is required."
                                         size="42"
                                         />
                            <p:watermark for="url" value="Enter URL" />
                            <p:message for="url" />
                        </td>
                    </tr>
                    <tr align="center">
                        <td>Classifier:</td>
                        <td>
                            <p:selectOneMenu value="#{classifierBean.chosenClsf}">
                                <f:selectItems value="#{classifierBean.clsf}" /> 
                            </p:selectOneMenu>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <p:commandButton value="Classify Post" actionListener="#{classifierBean.classifyBlog()}" 
                                             id="sendRequest" update="res" ajax="false"/>
                        </td>
                    </tr>
                </table>
                <hr/>   
                <div align="center">
                    <h:outputText id="res" value="#{classifierBean.result}" style="font-weight:bold; font-size: 40px"/>
                    <div align="center">
                        <h:graphicImage value="#{classifierBean.image}"
                                        style="height: 400px; width:550px;" /> 
                    </div>
                </div>
            </h:form>

        </div>


    </h:body>
</html>

